#include <algorithm>
#include <iostream>
#include <set>

using namespace std;
const int maxn = 5 + 1e2;

int n;
int p2[maxn];

int ans;
int a[maxn], path[maxn];
void dfs(int dep) {
    if (path[dep - 1] == n) {
        if (dep - 1 < ans) {
            ans = dep - 1;
            for (int i = 1; i <= ans; ++i) a[i] = path[i];
        }
        return;
    }
    if (path[dep - 1] > n) return;
    if (ans <= dep) return;
    if (path[dep - 1] * p2[ans - dep + 1] < n) return;

    set<int> visit;
    for (int i = 1; i < dep; ++i) {
        for (int j = 1; j <= i; ++j) {
            int num = path[i] + path[j];
            if (visit.count(num)) continue;
            if (num > path[dep - 1] && num <= n) {
                path[dep] = num;
                visit.insert(num);
                dfs(dep + 1);
            }
        }
    }
}

int main() {
    p2[0] = 1;
    for (int i = 1; i < maxn; ++i) p2[i] = p2[i - 1] * 2;
    while (scanf("%d", &n), n > 0) {
        ans = 14, path[1] = 1;
        dfs(2);
        for (int i = 1; i <= ans; ++i)
            printf("%d ", a[i]);
        puts("");
    }
}